import java.math.BigInteger;

/**
 * Created by IntelliJ IDEA.
 * User: caporegim
 * Date: 08.08.12
 * Time: 22:52
 * To change this template use File | Settings | File Templates.
 */
public class FibonachiGenerator implements Fibonachi{
    private BigInteger value1 = new BigInteger("0");
    private BigInteger value2 = new BigInteger("1");
    @Override
    public synchronized BigInteger next() {
        BigInteger value = value1.add(value2);
        value1 = value2;
        value2 = value;
        return value;
    }

}
